import request from '@/utils/request'

// 分页查询收入合同列表
export function contractList(params) {
  return request({
    url: '/basic/entrust/agreement/list',
    method: 'post',
    data: params,
  })
}

// 查询收入合同详情
export function contractDetail(agreementId) {
  return request({
    url: `/basic/entrust/agreement/getInfo/${agreementId}`,
    method: 'get',
  })
}

// 新增收入合同
export function contractAdd(data) {
  return request({
    url: `/basic/entrust/agreement/add`,
    method: 'post',
    data: data
  })
}

// 修改收入合同
export function contractEdit(data) {
  return request({
    url: `/basic/entrust/agreement/edit`,
    method: 'post',
    data: data
  })
}

// 变更收入合同
export function contractUpdate(data) {
  return request({
    url: `/basic/entrust/agreement/updateSubmit`,
    method: 'post',
    data: data
  })
}

// 变更签订状态
export function contractChangeSignStatus(data) {
  return request({
    url: `/basic/entrust/agreement/changeSignStatus`,
    method: 'post',
    data: data
  })
}

// 完成收入合同
export function contractComplete(data) {
  return request({
    url: `/basic/entrust/agreement/completed`,
    method: 'post',
    data: data
  })
}

// 开启收入合同
export function contractOpen(data) {
  return request({
    url: `/basic/entrust/agreement/open`,
    method: 'post',
    data: data
  })
}

// 删除收入合同
export function contractDelete(agreementId) {
  return request({
    url: `/basic/entrust/agreement/remove/${agreementId}`,
    method: 'get',
  })
}

// 获取收入合同编号
export function genContractNumber() {
  return request({
    url: '/basic/entrust/agreement/genAgreementNumber',
    method: 'get',
  })
}

// 获取收入合同统计数据
export function genContractCount(data) {
  return request({
    url: '/basic/entrust/agreement/agreementCount',
    method: 'post',
    data: data
  })
}

// 绑定合同评审任务
export function bindContractTask(data) {
  return request({
    url: '/basic/entrust/agreement/bindContractTask',
    method: 'post',
    data: data
  })
}
